CC=g++
AR=ar
ARFLAGS=-cvq
CFLAGS=-c -Wall
LDFLAGS=
SOURCES=port_comm.cpp
OBJECTS=$(SOURCES:.cpp=.o)
LIB_NAME=libportcomm.a

lib: $(OBJECTS)
	mkdir -p lib
	$(AR) $(ARFLAGS) lib/$(LIB_NAME) $(OBJECTS)

# prerequites is $<
%.o: %.cpp
	$(CC) $(CFLAGS) $< -o $@

clean:
	rm -rf *~ lib $(OBJECTS)